<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Bel_Forms_Builder</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Bel_Forms_Builder</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Form builder class. Tool to build form using description in a XML files  ('FORMS_FILES' constant should be defined by path to these XML configs files) or  it could build forms without any config</p>
	<ul class="tags">
				<li><span class="field">author:</span> Konstantin Shamko &lt;<a href="mailto:konstantin.shamko@gmail.com">konstantin.shamko@gmail.com</a>&gt;</li>
				<li><span class="field">version:</span> 0.0.1</li>
				<li><span class="field">copyright:</span> Copyright (c) 2009 Konstantin Shamko</li>
				<li><span class="field">license:</span> New</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Libs---Bel---Forms---Builder.php.html">/Libs/Bel/Forms/Builder.php</a> (line <span class="field">15</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_action" title="details" class="var-name">$_action</a>
				</div>
																<div class="var-title">
					<span class="var-type">array</span>
					<a href="#$_fields" title="details" class="var-name">$_fields</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_formname" title="details" class="var-name">$_formname</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$_method" title="details" class="var-name">$_method</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																				
												<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$formname</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$action</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span> = <span class="var-default">'POST'</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#addAttributes" title="details" class="method-name">addAttributes</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$attributes</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#addElement" title="details" class="method-name">addElement</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$options</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#addSubElement" title="details" class="method-name">addSubElement</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$parent_element</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$element_type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$new_element</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getElement" title="details" class="method-name">getElement</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$offset</span> = <span class="var-default">NULL</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#populateForm" title="details" class="method-name">populateForm</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$form_data</span>)
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../Bel/Bel_Forms_Builder.html">Bel_Forms_Builder</a></span>
										<a href="#removeElement" title="details" class="method-name">removeElement</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setAction" title="details" class="method-name">setAction</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$action</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setMethod" title="details" class="method-name">setMethod</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#toArray" title="details" class="method-name">toArray</a>
										()
									</div>
								</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$_action" id="$_action"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_action</span>
						(line <span class="line-number">22</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Form action</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$_fields" id="$_fields"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$_fields</span>
						(line <span class="line-number">36</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Array of form fields</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$_formname" id="$_formname"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_formname</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">43</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Form name</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$_method" id="$_method"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$_method</span>
						(line <span class="line-number">29</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Form method (POST or GET)</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">55</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor. Sets form action, name &amp; method. If XML config file was found  adds fields to form according to this file</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$formname</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$action</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span> = <span class="var-default">'POST'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$formname</span><span class="var-description">: - form name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$action</span><span class="var-description">: - form action</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$method</span><span class="var-description">: - form method</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaddAttributes" id="addAttributes"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">addAttributes</span> (line <span class="line-number">134</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds attributes to elements that are in form</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			addAttributes
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$attributes</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: - name of element</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$attributes</span><span class="var-description">: - associative array with additional element params</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaddElement" id="addElement"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">addElement</span> (line <span class="line-number">105</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds element to form</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			addElement
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$options</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$type</span><span class="var-description">: - element type (i.e. text, textarea, select etc.)</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: - name of element</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$options</span><span class="var-description">: - associative array with additional element params</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaddSubElement" id="addSubElement"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">addSubElement</span> (line <span class="line-number">186</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds subelement. (i.e. add options into select)</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			addSubElement
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$parent_element</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$element_type</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$new_element</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$parent_element</span><span class="var-description">: - parent element name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$element_type</span><span class="var-description">: - subelement type</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$new_element</span><span class="var-description">: - associative array with additional subelement params</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetElement" id="getElement"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getElement</span> (line <span class="line-number">171</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Gets an element.</p>
	<ul class="tags">
				<li><span class="field">return:</span> - array with element data</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getElement
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$offset</span> = <span class="var-default">NULL</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: - element name</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$offset</span><span class="var-description">: - subelement name</span>			</li>
				</ul>
		
			
	</div>
<a name="methodpopulateForm" id="populateForm"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">populateForm</span> (line <span class="line-number">197</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Populates form with values</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			populateForm
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$form_data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$form_data</span><span class="var-description">: - associative array with form elements values. Keys - form elements' names, values - form elements' values</span>			</li>
				</ul>
		
			
	</div>
<a name="methodremoveElement" id="removeElement"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">removeElement</span> (line <span class="line-number">159</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Removes element from form</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../Bel/Bel_Forms_Builder.html">Bel_Forms_Builder</a></span>
		<span class="method-name">
			removeElement
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: - element name</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetAction" id="setAction"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setAction</span> (line <span class="line-number">81</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets form action</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setAction
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$action</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$action</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetMethod" id="setMethod"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setMethod</span> (line <span class="line-number">92</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets form method</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setMethod
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$method</span>			</li>
				</ul>
		
			
	</div>
<a name="methodtoArray" id="toArray"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">toArray</span> (line <span class="line-number">148</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Transforms form from object to array</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			toArray
		</span>
				()
			</div>
	
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Mon, 01 Mar 2010 18:58:50 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0</a>
	</p>
	</div></body>
</html>